/**
 * 
 */
package org.mhz.sit.service;

import java.util.List;

import org.mhz.sit.dataaccess.SettingsDAO;
import org.mhz.sit.entity.Settings;
import org.mhz.sit.util.DatabaseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Mahan
 *
 * Configure setting service
 */
public class ConfigureSettingsService implements SettingsService
{
    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureSettingsService.class);

    private SettingsDAO mSettingsDAO = new SettingsDAO();

    /* (non-Javadoc)
     * @see org.mhz.sit.service.SettingService#getList()
     */
    @Override
    public List<Settings> getList()
    {
        final List<Settings> settings = mSettingsDAO.getAll();   
        
        return settings;
    }

    /* (non-Javadoc)
     * @see org.mhz.sit.service.SettingsService#saveSettings(java.util.List)
     */
    @Override
    public void saveSettings(final List<Settings> aSettings)
    {
        DatabaseUtil.saveOrUpdateSettings(aSettings);
    }    
}
